<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>选择器权重</title>
		<!-- 选择器权重越高，选中几率越大 -->
		<style>
			*{  /*权值 0 很容易被覆盖*/
				color:#55ff00;
				background: #ffff7f;
			}
			div{/*权值 1*/
			color: #ffaaff;	
			background: #55aaff;
			}
			.d1{/*权值 10*/
				color: #55aa7f;
				background: #ff5500;
			}
			div.d1{/*选择器权值之和   权值1+10  11*/
				color: #00ff00;
				background: #0000ff;
			}
			#d1{/*权值 12*/
				font-size: 25px;
				color: #aa0000;
				background: #000000;
			}
			div#d1{/*权值 101*/
				font-size: 20px;
				color: #ffaa00;
				background: #aa00ff;
			}
			div#d1:hover{/*权值 111*/
				color: #55ffff;
				background: #ffaaff;
			}
		</style>
	</head>
	<body>
		<div class="d1" id="d1" style="color: red;">Lorem ipsum, dolor sit amet consectetur adipisicing elit. Laborum, culpa ullam, perferendis autem atque amet iure dolorum saepe in vitae enim nulla suscipit quae quia fuga exercitationem facilis! Hic, in.</div>
	</body>
</html>